/**
 * 材料证照配置 api js
 */
import request from "@/utils/request";

/**
 * 根据HDLOid查询清单主材料
 * @param {*} hdlOid
 */
export function pageMaterial(hdlOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      `/yxpz/materials/queryMainByhdlOid/${hdlOid}`,
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    }
  });
}

// 初始化配置页面
export function handleInitMater(id, serviceOid) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/SxMaterialElmsConfig/init?materialOid=" +
      id +
      "&serviceOid=" +
      serviceOid,
    method: "get"
  });
}

// 保存或者修改
export function saveOrUpdate(data) {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH + "/yxpz/SxMaterialElmsConfig/save",
    method: "post",
    headers: {
      "Content-Type": "application/json;charset=UTF-8"
    },
    data: data
  });
}

/**
 * 查询所有的共享证照数据
 * @returns
 */
export function queryMaterBill() {
  return request({
    url:
      process.env.VUE_APP_KSTB_ROUTE_PATH +
      "/yxpz/shareLicense/getShareLicenseList",
    method: "get"
  });
}
